<div class="layui-form" lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit"
    style="padding: 20px 30px 0 0;">


    <fieldset class="layui-elem-field layui-field-title">
        <legend>请填写发货信息</legend>
    </fieldset>

    <div id='thirdPartSend'>
        <div class="layui-form-item">
            <label class="layui-form-label">快递公司:<label style="color: red">*</label></label>
            <div class="layui-input-block">
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params);'>
                <select name="ExpressCode" xm-select="ExpressCode" xm-select-radio="" xm-select-search=""
                    xm-select-skin="default" xm-select-search-type="dl" >
                    <option value=""></option>
                </select>
              </script>

                <input type="hidden" name="ExpressName" id="ExpressName" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">运单号码:<label style="color: red">*</label></label>
            <div class="layui-input-block">
                <input type="text" name="ExpressNumber" id="ExpressNumber" placeholder="请输入" autocomplete="off"
                    class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
        </div>
    </div>

</div>

<script>

    layui.data.getSelSource = function (d) {
        layui.use(['form', 'admin', 'formSelects'], function () {

            var $ = layui.$;
            var form = layui.form;
            var admin = layui.admin;
            var formSelects = layui.formSelects;

            form.render(null, 'layuiadmin-app-form-submit');

            formSelects.config('ExpressCode', {
                keyName: 'Name',            //自定义返回数据中name的key, 默认 name
                keyVal: 'Code'          //自定义返回数据中value的key, 默认 value
            });

            admin.req({
                url: layui.setter.APIUrl + '/Admin/src/express.json', //实际使用请改成服务端真实接口
                done: function (res) {
                    layui.formSelects.data('ExpressCode', 'local', {
                        arr: res.Data
                    });
                }
            });

            formSelects.on('ExpressCode', function (id, vals, val, isAdd, isDisabled) {
                var data = form.val("layuiadmin-app-form-submit");

                if (isAdd) {
                    $('#ExpressName').val(val.name);
                } else {
                    $('#ExpressName').val('');
                }

            });

        });

    };



    layui.use(['admin', 'table', 'element', 'form', 'formSelects'], function () {
        var $ = layui.$;
        var form = layui.form;
        var admin = layui.admin;
        var view = layui.view;
        var table = layui.table;



    });

</script>